<template>
  <div class="all_page">
    <div class="all">
        <div class="the-top-hj the-top" v-show='id==18'>
            <h2>K金网今日黄金价</h2>
            <div class="price">
                <div class="price-box">
                    <span>{{data.gold_price}}</span>
                    <em>元/克</em>
                </div>
            </div>
            <a href="javascript:void(0)" class="xs-a">加工费：{{data.goods_jgf}}元/克</a>
            <a href="javascript:void(0)" class='xs-img'>
                <img :src="img_url+'/ycl/ycl.png'" alt="">
            </a>
        </div>
        <!--白银-->
        <div class="the-top-by the-top" v-show='id==19'>
            <h2>K金网今日白银价</h2>
            <div class="price">
                <div class="price-box">
                    <span>{{data.gold_price}}</span>
                    <em>元/克</em>
                </div>
            </div>
            <a href="javascript:void(0)" class="xs-a">加工费：{{data.goods_jgf}}元/克</a>
            <a href="javascript:void(0)">
                <img :src="img_url+'/ycl/by.png'" alt="">
            </a>
        </div>
        <!--铂金-->
         <div class="the-top-by the-top the-top-bj" v-show='id==20'>
             <h2>K金网今日铂金价</h2>
            <div class="price">
                <div class="price-box">
                    <span>{{data.gold_price}}</span>
                    <em>元/克</em>
                </div>
            </div>

            <a href="javascript:void(0)" class="xs-a">加工费：{{data.goods_jgf}}元/克</a>
            <a href="javascript:void(0)"><img :src="img_url+'/ycl/by.png'" alt=""></a>
        </div>
        <div class="product-situation clearfix">
            <div class="tab clearfix">
                <ul class="tabs clearfix">
                    <li class="tab-active tab-detail tab-li">
                        <a href="javascript:void(0)">商品介绍</a>
                    </li>
                    <li class="tab-li tab-problems">
                        <a href="javascript:void(0)">商品详情</a>
                    </li>
                </ul>
            </div>

            <div class="content-detail content">
                <div class="the-intro">
                    <div class="intro-item-js clearfix">
                        <span>产品介绍：</span>
                        <div class="intro-item-js-right">
                            <p class="intro-name">{{data.goods_name}}</p>
                            <p class="intro-remark">{{data.goods_remark}}</p>
                        </div>

                    </div>
                    <div class="intro-item">
                        <span>加工周期：</span>

                        <p class="intro-item-right">{{data.ag_cycle}}个工作日</p>

                    </div>
                    <div class="intro-item">
                        <span>批发销售周期：</span>
                        <p class="intro-item-right">不大于{{data.hk_cycle}}天</p>
                    </div>
                    <div class="intro-item">
                        <span>未销售处理：</span>
                        <p class="intro-item-right">销售方以合同约定价全额收购</p>
                    </div>
                    <div class="intro-item">
                        <span>收益体现：</span>
                        <p class="intro-item-right">成品批发销售后盈利</p>
                    </div>
                    <div class="intro-item">
                        <span>预期收益：</span>

                        <p class="intro-item-right" v-if='id==18'>每100g黄金原料预计盈利¥532-665</p>

                        <p class="intro-item-right" v-if='id==19'>每1000g白银原料预计盈利¥10-20</p>

                        <p class="intro-item-right" v-if='id==20'>每100g铂金原料预计盈利¥1044-1392</p>

                    </div>
                </div>
                <div class="con-title clearfix">
                    <em></em>
                    <span>交易流程</span>
                </div>
                <a href="javascript:void(0)" class="clearfix lct-a">
                    <img :src="img_url+'/ycl/lct.png'" alt="" class="lct">
                </a>


            </div>
            <div class="content-problems content">
                {$v.goods_content|htmlspecialchars_decode}
            </div>
        </div>

        <a href="javascript:void(0)" class="to-buy" data-id="{$v.goods_id}">立即下单</a>

    </div>
    <div class="shadow-detail">
        <div class="detail-box">
            <div class="box">
                <div class="row-box clearfix">
                    <img src="{$v.original_img}" alt="" class="ori-img">
                    <div class="box-text">
                        <span class="total">¥0</span>
                        <p>已选："<em class="select-weight"></em>"</p>
                    </div>
                </div>
                <div class="row-box clearfix">
                    <div class="row-left sub-box">
                        <h5>{$v.goods_name}</h5>
                        <if condition="$v.goods_id eq 18">
                        <h6>纯金原材料，正品保障</h6>
                        </if>
                        <if condition="$v.goods_id eq 19">
                            <h6>Ag999，正品保障</h6>
                        </if>
                        <if condition="$v.goods_id eq 20">
                            <h6>Pt950，正品保障</h6>
                        </if>
                    </div>
                    <div class="row-right">
                        <p>￥<em class="shop_price">{$v.gold_now_price}</em>元/克</p>
                    </div>
                </div>
                <div class="row-box borderB">
                    <h6 class="row-box-title">克重</h6>
                    <!--黄金铂金-->
                    <if condition="$v.goods_id neq 19">
                    <div class="row-weight">
                        <span class="weight-span ty-span" data-status="0" data-weight="1" data-ty="1">1g（体验金）</span>
                    </div>
                        <else/>
                    </if>
                    <div class="row-weight">

                        <span class="weight-span" data-status="0" data-weight="10">10g</span>
                        <span class="weight-span" data-status="0" data-weight="20">20g</span>
                        <span class="weight-span" data-status="0" data-weight="50">50g</span>
                        <span class="weight-span" data-status="0" data-weight="100">100g</span>
                    </div>
                    <!--黄金铂金-->

                </div>
                <div class="row-box input-box borderB">
                    <span class="row-box-title">输入克重</span>
                    <input type="text" class="weight-input"/>
                    <span class="dw-g">g</span>
                </div>
                <!--黄金铂金显示，白银不显示-->
                <if condition="$v.goods_id neq 19">

                    <p class="spec-tips" style="display:none">
                        <em>* 特别提醒 * </em>
                        <span>1g体验金仅供体验，不予发货。</span>
                    </p>
                </if>
                <!--黄金铂金显示，白银不显示-->
            </div>
            <a href="javascript:void(0)" class="now-buy">立即购买</a>
        </div>
    </div>
  </div>
</template>

<script type="text/javascript">
import global from '../global.vue'
import axios from 'axios'
import $ from 'jquery'

export default {
  data(){
    return{
      base_url:global.base_url,
      img_url:global.img_url,
      id:'',
      data:''
    }
  },
  mounted:function(){
    var id = this.$route.params.id;
    this.id = id;
    var that = this;
    $.ajax({
      url: 'https://m.kjinwang.com/api/Goods/ycl_detail',
      type: 'GET',
      dataType: 'JSON',
      data:{id:id},
      success: function (res) {
        that.data = res;
        console.log(res)
      },
      fail:function(err){
        // console.log(err)
      }
    });

  },
  }
</script>

<style src='../assets/css/ycl_detail.css'>
</style>
